package com.spa.infrastructure.enums.dict.order;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.spa.infrastructure.annotation.SysDictEnumAnnotation;
import com.spa.infrastructure.enums.dict.IBaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
@SysDictEnumAnnotation(key = "orderTransferStatus", desc = "转单状态")
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum OrderTransferStatusEnum implements IBaseEnum {

    $10(10, "待转单",1,0),
    $20(20, "已转单",2,0),
    ;

    private final Integer code;

    private final String desc;
    //排序
    private final Integer sort;
    //状态  0 启用  1 不启用
    private final Integer status;

    public static OrderTransferStatusEnum byCode(int code) {
        for (OrderTransferStatusEnum value : values()) {
            if (value.code == code) return value;
        }
        return null;
    }

}
